<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>出金设置添加</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/common/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/common/js/ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/common/js/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>

<body>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <form action="" id="Goldadd" method="post" class="form form-horizontal" enctype="multipart/form-data">
            <div class="form-group">
                <label class="col-sm-3 control-label">出金名称：</label>
                <div class="col-sm-8">
                    <input id="ch_name" name="ch_name"  class="form-control" type="text"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">英文名称：</label>
                <div class="col-sm-8">
                    <input id="en_name" name="en_name"  class="form-control" type="text"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">最高出金：</label>
                <div class="col-sm-8">
                    <input id="max_into" name="max_into"  class="form-control" type="number"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">最低出金：</label>
                <div class="col-sm-8">
                    <input id="min_into" name="min_into"  class="form-control" type="number"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">汇率：</label>
                <div class="col-sm-8">
                    <input id="rate" name="rate"  placeholder="最多保留小数点后3位" class="form-control" type="number"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">百分比手续费：</label>
                <div class="col-sm-8">
                    <input id="fee" name="fee"  placeholder="请安百分比换算后填入（比如：1% = 0.01，填入0.01）" class="form-control" type="number"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">最高手续费：</label>
                <div class="col-sm-8">
                    <input id="max_fee" name="max_fee"  placeholder="最高手续费和百分比手续费同时存在时将已最高作为计算(每笔扣当前设置的金额)" class="form-control" type="number"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否启用：</label>
                <div class="col-sm-8">
                    <select class="form-control" style="height: 34px;" name="state" id="state">
                        <option value="1">启用</option>
                        <option value="2">不启用</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">出金说明：</label>
                <div class="col-sm-8">
                    <textarea id="content" style="height: 320px;" name="remarks" style=""></textarea>
                </div>
            </div>

            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <button type="button" class="btn btn-success radius"  onclick="GoldSet_AddData()" id="admin-role-save" name="admin-role-save">
                        <i class="icon-ok"></i> 确定
                    </button>

                    <a style="margin-left: 20px;"onclick="layer_close();" class="btn btn-success btn-warning">
                        <i class="icon-ok"></i> 返回
                    </a>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->

<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/common/js/layer_show.js"></script>

<!-- iCheck -->
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<!-- Peity -->
<script>

    var editor;
    $(document).ready(function () {
         editor=UE.getEditor('content');
    });

    function edit() {
        $('.ueditor').show();
    }

    function GoldSet_AddData() {
        var content = editor.getContent();
        var ch_name= $("#ch_name").val();
        var en_name= $("#en_name").val();
        var rate= $("#rate").val();
        if(content=='' ||ch_name=='' || en_name==''|| rate=='') {
            layer.msg('請確保信息完整');return;
        } else {
            var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
            var form = document.getElementById('Goldadd');
            fdata = new FormData(form);
            XHR = new XMLHttpRequest();
            XHR.open('POST','__MODULE__/System/GoldSet_Add',true);
            XHR.onreadystatechange=function(){
                if(XHR.readyState == 4) {
                    layer.close(index);
                    layer.msg(XHR.responseText, {time: 1000});
                    setTimeout(function () {location.reload();}, 1000);
                }
            };
            XHR.send(fdata);
        }
    }
</script>
</body>
</html>
